package com.snline.crm.logistics.service;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.snline.crm.logistics.dao.inter.IProjectMapper;
import com.snline.crm.logistics.entity.ProjectDetails;
import com.snline.crm.logistics.entity.ProjectInfo;

/**
 * 项目信息
 * @author admin
 *
 */
@Service("projectService")
public class ProjectService{

	@Resource
	private IProjectMapper projectMapper;
	
	/**
	 * 用户的取得
	 * @param user 用户信息
	 * @return 用户信息
	 */
	public List<ProjectInfo> findProjectUser(String userId) {

	    return projectMapper.selectProjectInfo(userId);
	}
	
	/**
	 * 用户的取得
	 * @param user 用户信息
	 * @return 用户信息
	 */
	public List<ProjectInfo> findMyProjectUser(String userId) {

	    return projectMapper.selectMyProjectInfo(userId);
	}

	/**
	 * 用户的取得
	 * @param user 用户信息
	 * @return 用户信息
	 */
	public List<ProjectDetails> findUserByPjId(String pjId) {

	    return projectMapper.selectUserByPjId(pjId);
	}
	
	/**
	 * 用户的取得
	 * @param user 用户信息
	 * @return 用户信息
	 */
	public ProjectInfo findProjectUserById(String pjId) {

	    return projectMapper.selectProjectInfoById(pjId);
	}

    /**
     * 项目的删除
     * @param user 用户信息
     * @return 用户信息
     */
    public int deleteProjectInfo(String pjId) {

        return projectMapper.deleteProjectInfo(pjId);
    }
    
    /**
     * 项目信息添加
     * @param project 项目信息
     * @return 项目信息
     */
    public int insertProjectInfo(ProjectInfo projectInfo) {

        return projectMapper.insertProjectInfo(projectInfo);
    }
    
    /**
     * 项目信息修改
     * @param project 项目信息
     * @return 项目信息
     */
    public int updateProjectInfo(ProjectInfo projectInfo){

        return projectMapper.updateProjectInfo(projectInfo);
    }
	
	/**
	 * @return the projectMapper
	 */
	public IProjectMapper getProjectMapper() {
		return projectMapper;
	}

	/**
	 * @param projectMapper the projectMapper to set
	 */
	public void setProjectMapper(IProjectMapper projectMapper) {
		this.projectMapper = projectMapper;
	}

	/**
     * 项目的删除
     * @param user 用户信息
     * @return 用户信息
     */
    public int deleteProjectDetails(String pjId) {

        return projectMapper.deleteProjectDetails(pjId);
    }
    
    /**
     * 项目信息添加
     * @param project 项目信息
     * @return 项目信息
     */
    public int insertProjectUser(ProjectDetails projectDetails) {

        return projectMapper.insertProjectUser(projectDetails);
    }
    
    
}
